<% if !@client.errors.blank? || !@user.errors.blank? %>
    <% errors = @client.errors.blank? ? @user.errors : @client.errors %>

    <%= render :partial => 'shared/error_messages', :locals => { :errors => errors } %>
<% end %>

<% form_for [:admin, @client] do |f| %>
    <p><span class="bold-text">Nombre / Raz&oacute;n Social:</span><br/><%= f.text_field :name %></p>
    <p><span class="bold-text">CUIT:</span><br/><%= f.text_field :cuit %></p>
    <p><span class="bold-text">Direcci&oacute;n:</span><br/><%= f.text_field :address %></p>
    <p><span class="bold-text">Provincia / Localidad:</span><br/><%= f.text_field :province %></p>
    <p><span class="bold-text">Email:</span><br/><%= f.text_field :email %></p>
    <p><span class="bold-text">Tel&eacute;fono:</span><br/><%= f.text_field :phone %></p>
    <p><span class="bold-text">C&oacute;digo Postal:</span><br/><%= f.text_field :zip_code %></p>
    <p><span class="bold-text">Franquicia KVN:</span><br/>S&iacute; <%= f.radio_button :kvn_branch, 1, :checked => (@client.kvn_branch == true) %>  No <%= f.radio_button :kvn_branch, 0, :checked => (@client.kvn_branch == false) %></p>

    <% if @client.new_record? %>

        <%= fields_for :user do |u| %>
          <p>
            <span class="bold-text"><%= u.label :login, 'Usuario:' %></span><br />
            <%= u.text_field :login %>
          </p>

          <p><span class="bold-text">
            <%= u.label :password, 'Contraseña:' %></span><br />
            <%= u.password_field :password %>
          </p>

          <p>
            <span class="bold-text"><%= u.label :password_confirmation, 'Repetir Contraseña:' %></span><br />
            <%= u.password_field :password_confirmation %>
          </p>
        <% end %>

    <% end %>
    <%= f.submit 'Guardar' %>
<% end %>